package org.virbraligo.vboxjavaservice.gui.validator;

import javax.swing.JComponent;
import javax.swing.JTextField;

public class NTServiceNameValidator implements Validator{

	public String validate(JComponent comp) {
		String result = null;
		String ntservicename = ((JTextField) comp).getText().trim();
		if(ntservicename.equals("")){
			result = "NT ServiceName must not be null";
		}
		if(ntservicename.contains(" ")){
			result = "NT ServiceName must not have space characters";
		}
		return result;
	}

}
